package com.wing.cabinet.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.cabinet.model.entity.ReceiveRecord;
import com.wing.cabinet.model.request.ReceiveRecordForm;
import com.wing.cabinet.model.response.ReceiveRecordVO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 领取记录表-Service
 *
 * @author
 */
public interface ReceiveRecordService extends IService<ReceiveRecord> {

    /**
     * 添加
     *
     * @param receiveRecordForm
     * @return
     */
    int add(ReceiveRecordForm receiveRecordForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<ReceiveRecordVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<ReceiveRecordVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    ReceiveRecordVO get4appById(Long id);

    /**
     * 统计组员共享当天的总金额
     * @param todayTime
     * @return
     */
    Double sumByTotalMoney(Long authorityManageId,String todayTime,String skuCode);

    /**
     * 统计组员共享当天的总数量
     * @param todayTime
     * @return
     */
    Integer sumByTotalQuantity(Long authorityManageId,String todayTime);

    Integer sumByTotalQuantityOne(Long id, String todayTime, String skuCode);

    /**
     * 统计组员共享授信领用金额
     * @param startTime
     * @param endTime
     * @return
     */
    Double sumMoney(Long authorityManageId,String startTime,String endTime,String skuCode);

    /**
     * 统计组员共享授信领用数量
     * @param startTime
     * @param endTime
     * @return
     */
    Integer sumQuantity(Long authorityManageId,String startTime,String endTime);
    Integer sumQuantityOne(Long authorityManageId,String startTime,String endTime,String skuCode);

    /**
     * 统计组员独立授信当天的总金额
     * @param receiverId
     * @param todayTime
     * @return
     */
    Double sumIndependentByTotalMoney(Long authorityManageId,Long receiverId,String todayTime,String skuCode);

    /**
     * 组员独立授信领用金额
     * @return
     */
    Double sumIndependentMoneyByReceiverId(Map<String, Object> params);

    /**
     * 根据条件查询组员当天数据
     * @param params
     * @return
     */
    ReceiveRecordVO getIntraDayReceiveRecordByParams(Map<String, Object> params);

    ReceiveRecordVO getReceiveRecordByParams(Map<String, Object> params);

    Integer sumIndependentByTotalQuantity(Long authorityManageId,Long receiverId,String todayTime);
    Integer sumIndependentByTotalQuantityOne(Long authorityManageId,Long receiverId,String todayTime,String skuCode);

    Integer sumIndependentQuantityByReceiverId(Map<String, Object> params);


}
